package a66weding.com.jiehuntong.common;

import android.view.View;

import java.util.Calendar;

/**
 * @version :
 * @creator : AxDu
 * @create-time : 2016/9/18
 * @description :
 */
public abstract   class NoDoubleClickListener implements  View.OnClickListener  {

    final int MIN_CLICK_DELAY_TIME = 1000;
    private long lastClickTime = 0;
    @Override
    public void onClick(View v) {
        long   currentTime = Calendar.getInstance().getTimeInMillis();
        if(currentTime-lastClickTime>MIN_CLICK_DELAY_TIME){
            lastClickTime  =  currentTime;
            onNoDoubleClick(v);
            return ;
        }

    }

    protected abstract void onNoDoubleClick(View v);


}
